import storage from 'store'

const app = {
  state: {
    showNav: true,
    showTab: true,
    color: '#1890ff',
    accounts: []
  },
  mutations: {
    TOGGLE_NAV: (state, value) => {
      state.showNav = value
      storage.set('app.showNav', value)
    },
    TOGGLE_TAB: (state, value) => {
      state.showTab = value
      storage.set('app.showTab', value)
    },
    TOGGLE_COLOR: (state, value) => {
      state.color = value
      storage.set('app.color', value)
    },
    TOGGLE_ACCOUNTS: (state, value) => {
      state.accounts = value
      storage.set('app.accounts', value)
    }
  },
  actions: {}
}

export default app
